import { getAxios } from "../util/HttpUtil"

export namespace OrderRequest {
/**
 * 插入订单
 * @param order
 * @return
 */
  export function insertOrder(order: Order) {
    let url = "/order/addOrder"
    return getAxios().post(url,order)
  }


  export function getAll(storeId) {
    let url = "/order/findAllOrder?storeId="+storeId
    return getAxios().get(url)
  }

}
/**
 * 订单
 */
export class Order {
  /**
   * 订单ID
   */
  orderId: number;
  /**
   * 总价
   */
  totalPrice: number;
  // 订单状态（可选）
  status?: number;
  /**
   * 订单创建时间
   */
  createdTime: string;
  // 更新时间（可选）（格式：yyyy-MM-dd HH:mm:ss，时区：GMT+8）
  updateTime?: string

  constructor(totalPrice: number, createdTime: string) {
    this.totalPrice = totalPrice;
    this.createdTime = createdTime;
  }
}
